<?php

require_once(dirname(__FILE__) . '/quickpay_service.php');

if ($_SERVER["REQUEST_METHOD"] != 'POST') {
    die("NOTIFY ONLY SUPPORT POST REQUEST");
}
$quickpay_service = new quickpay_service($_POST, QUICKPAY_NOTIFY_SEVICE);
if (!$quickpay_service->verify_notify()) {
    die("upop notify, but verify failed");
}
$html = '<meta http-equiv="Content-Type" content="text/html; charset='.$quickpay_service->arr_parameter['charset'].'" />';
$html .= '<script  type="text/javascript">window.onload=function(){document.pay_form.submit();}</script>';
$html .= '<form name="pay_form" action="/?r=order/result" method="post">';

foreach ($quickpay_service->arr_parameter as $key => $value) {
  $html .= '<input type="hidden" name="' . $key . '" value="' . $value . '" />';
}
$html .= '<input type="hidden" name="pay_type" value="1" />';
$html .= '</form>';
echo $html;
?>